/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package funkcje.bankowe;

import java.util.regex.PatternSyntaxException;

/**
 *
 * @author Bartek
 */
public class SyntaxExpert {
               
    public boolean czyNazwa(String imie){
 //Check if the regex matches a string entirely
 try
 {
     
 boolean foundMatch = imie.matches("[A-Z]{1}[a-z]{1,29}");
 System.out.println("foundMatch = " + foundMatch);
 return foundMatch;
 } catch (PatternSyntaxException ex)
 {
 ex.printStackTrace();
 return false;
 }
    }
 public boolean czyPesel(String pesel){
 //Check if the regex matches a string entirely
 try
 {
 boolean foundMatch = pesel.matches("\\d{11}");
 System.out.println("foundMatch = " + foundMatch);
 return foundMatch;
 } catch (PatternSyntaxException ex)
 {
 ex.printStackTrace();
 return false;
 }

        //return false;
    }
}
